package fr.labri.macchiato.client.preferences;

import java.util.Date;

import com.smartgwt.client.widgets.calendar.CalendarEvent;

/**
 * Sample to create an event into the calendar
 * 
 * @author Michelle AVOMO
 *
 */
public class CalendarData {

	@SuppressWarnings("unused")
	private static CalendarEvent[] records;

	private static Date today = new Date();

	@SuppressWarnings("deprecation")
	private static int year = today.getYear();

	@SuppressWarnings("deprecation")
	private static int month = today.getMonth();

	@SuppressWarnings("deprecation")
	private static int start = today.getDate() - today.getDay();

	/**
	 * @return : the set of records as events in the calendar
	 */
	public static CalendarEvent[] getRecords() {
		//if (records == null) {
			
		//}
		return records = getNewRecords();
	}

	/**
	 * @return a calendar with set of events
	 */
	@SuppressWarnings("deprecation")
	public static CalendarEvent[] getNewRecords() {
		return new CalendarEvent[] {
				new CalendarEvent(1, "Meeting",
						"Shareholders meeting: monthly forecast report",
						new Date(year, month, start + 2, 9, 0, 0), new Date(
								year, month, start + 2, 14, 0, 0))};
	}
}
